package com.kafka.util;

import java.io.Reader;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;



/**
 * Created by Administrator on 2014/12/23.
 */
public class DbUtil {
	private static SqlSessionFactory sqlSessionFactory;
	private static Reader reader;
    public static SqlSessionFactory getSessionFactory() {
        try {
        	reader = Resources.getResourceAsReader("Configuration.xml");
        	sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return sqlSessionFactory;
    }
}